﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LitJson;

//地图结构
public class LevelData
{
    public int id = 0;
    public int level1 = 0;
    public int level2 = 0;
    public int score = 0;
    public int[] starNumbers = new int[3];
    public Vector3 pos;
    public string screenshot;
}

public class MapList
{
    public List<LevelData> map_list;
}

//厨师数据结构
public class ChefData
{
    public int id;
    public string name;
    public int condition;
    public string head_icon;
}

public class ChefList
{
    public List<ChefData> chef_list;
}

public class DataManager
{
    //单列
    private static DataManager instance;
    private DataManager() { }
    public static DataManager GetInstance()
    {
        if (instance == null)
        {
            instance = new DataManager();
        }
        return instance;
    }
    
    public MapList m_MapList = null;
    public ChefList m_chefList = null;


    public JsonData cardList = null;
    public void LoadMapData()
    {
        TextAsset textAsset_MapData = Resources.Load("Data/CardData") as TextAsset;

        cardList = JsonMapper.ToObject(textAsset_MapData.text);

        //m_MapList = JsonMapper.ToObject<MapList>(textAsset_MapData.text);



    }
}